<!doctype html>
<html class="no-js" lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<meta charset="utf-8"/>
<head th:fragment="public-head">
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">

    <title>MyJob</title>

    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- 网站图标 -->
    <link th:href="@{/images/favicon.ico}" type="img/x-icon" rel="shortcut icon">
    <!-- 所有CSS文件都包含在此处 -->
    <link rel="stylesheet" type="text/css" th:href="@{/css/vendor/bootstrap.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/vendor/iconfont.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/vendor/helper.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/plugins/plugins.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/style.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/plugins/paging.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/plugins/coco-message.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/plugins/jquery-confirm.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/public.css}">
    <!--<link rel="stylesheet" type="text/css" th:href="@{/css/style.css}">-->
    <style type="text/css">
        .coupletbox {
            width: 150px;
            height: 400px;
            position: absolute;
            z-index: 1000;
        }

        .coupletbox-1 {
            background: #00ff1f87;
            margin-left: 20px;
        }

        .coupletbox-2 {
            background: #00ff1f87;
            margin-right: 20px;
        }

        .closeBtn {
            border: 1px solid black;
            border-radius: 20px;
            width: 100px;
            height: 30px;
            margin: 400px 25px 0 25px;
            text-align: center;
            line-height: 30px;
            font-weight: 1000;
        }
    </style>
    <!-- Modernizr JS -->
    <script th:src="@{/js/vendor/modernizr-3.10.0.min.js}"></script>

</head>

<body class="template-color-2">

<!--头部导航栏 start-->
<header th:fragment="navigate"
        class="header-absolute black-logo-version header-sticky sticky-white no-padding d-none d-lg-block pt-25 pb-25">
    <div class="main-header">
        <div class="container-fluid pl-90 pl-lg-15 pl-md-15 pr-90 pr-lg-15 pr-md-15">
            <div class="row align-items-center no-gutters">

                <!--Logo start-->
                <div class="col-xl-2 col-lg-2 col-12">
                    <div class="logo">
                        <a th:href="@{/oa/account/homepage}"><img th:src="@{/images/logo.png}" alt=""></a>
                    </div>
                </div>
                <!--Logo end-->

                <!--Menu start-->
                <div class="col-xl-7 col-lg-7 col-12">
                    <nav class="main-menu">
                        <ul>
                            <li><a th:href="@{/oa/account/homepage}" >首页 <small class="icon-arrow"></small></a>
                            </li>
                            <li><a th:href="@{/oa/account/newsPage}">热点资讯 <small class="icon-arrow"></small></a>
                            </li>
                            <li><a th:href="@{/oa/jobs/joblisting/-}"><span class="label-status hot">热</span>职位 <small
                                    class="icon-arrow"></small></a>
                                <ul class="sub-menu"  sec:authorize="hasAnyAuthority('postJob')">
                                    <li><a th:href="@{/oa/jobs/postJobPage}">发布职位</a></li>
                                </ul>
                            </li>
                            <li sec:authorize="hasAnyAuthority('candidatesListing')">
<!--                            <li>-->
                                <a th:href="@{/oa/jobs/CandidatesListingPage}"> 候选应聘者  <small class="icon-arrow"></small></a>
                            </li>
                            <li>
                                <a th:href="@{/oa/company/companyListingPage}">入驻公司 <small class="icon-arrow"></small></a>
                            </li>
                            <li><a th:href="@{/oa/blog/blogPage}">博客 <small class="icon-arrow"></small></a>
                                <ul class="sub-menu" >
                                    <li><a th:href="@{/oa/blog/blogPage}">博客列表</a></li>
                                    <li><a sec:authorize="hasAnyAuthority('myBlog')" th:href="@{/oa/blog/myBlogPage}">我的博客</a></li>
                                    <li><a sec:authorize="hasAnyAuthority('createBlog')" th:href="@{/oa/blog/createBlogPage/-1/-1}">博客创作</a></li>
                                </ul>
                            </li>
                            <li sec:authorize="hasAnyAuthority('member')">
<!--                            <li>-->
                                <a th:href="@{/oa/company/memberPage}"><span class="label-status new">新</span> 企业会员 <small class="icon-arrow"></small></a>
                            </li>
                        </ul>
                    </nav>
                </div>
                <!--Menu end-->

                <!-- Cart & Search Area Start -->
                <div class="col-xl-3 col-lg-3 col-12">
                    <div class="header-btn-action d-flex justify-content-end">
                        <div class="btn-action-wrap d-flex">
                            <div class="jp-author item" sec:authorize="!isAuthenticated()">
<!--                            <div class="jp-author item" >-->
                                <a th:href="@{/oa/account/loginRegister}" style="text-decoration-line: none; ">
                                    <i class="lnr lnr-user"></i>
                                    <span>登录</span>
                                </a>
                            </div>
                            <div class="jp-author item" sec:authorize="isAuthenticated()">
                                <a style="text-decoration-line: none;">
                                    <i class="lnr lnr-home"></i>
                                    <span sec:authorize="isAuthenticated()" sec:authentication="principal.userName"></span>
                                </a>
                            </div>
                            <div class="jp-author item" sec:authorize="isAuthenticated()" >
<!--                            <div class="jp-author item">-->
                                <a th:href="@{/oa/blog/reviewsPage}"  sec:authorize="hasAnyAuthority('reviews')">
                                    <button class="ht-btn header-btn" >个人中心</button>
                                </a>
                                <a th:href="@{/oa/account/createAdvertisementPage}"  sec:authorize="hasAnyAuthority('createAdvertisement')">
                                    <button class="ht-btn header-btn" >个人中心</button>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- Cart & Search Area End -->
            </div>
        </div>
    </div>
</header>
<!--头部导航栏 end-->
<div style="height: 90px; border-bottom: 1px solid #e2e4ea"></div>

<!-- 侧边栏 start -->
<div th:fragment="sidebar" class="col-xl-2 col-lg-3">
    <div class="dashboard-sidebar">
        <div class="dashboard-menu">
            <ul class="nav">
                <!-- 消息 -->
                <li sec:authorize="hasAnyAuthority('reviews')">
                    <h3>消息</h3>
                    <ul>
                        <li><a th:class="${active == 'reviews' ? 'active' : ''}" th:href="@{/oa/blog/reviewsPage}"><i class="lnr lnr-bullhorn"></i> 我的评论 </a></li>
                    </ul>
                </li>
            <!-- ▼▼▼▼▼ ============ 招聘者模块 ============= ▼▼▼▼▼ -->
                <!-- 岗位 -->
                <li sec:authorize="hasAnyAuthority('candidateStatus','jobApproval','jobStatusManage')">
<!--                <li >-->
                    <h3>岗位</h3>
                    <ul>
                        <li sec:authorize="hasAnyAuthority('candidateStatus')"><a th:class="${active == 'candidateStatus' ? 'active' : ''}" th:href="@{/oa/jobs/candidateStatus}"><i class="lnr lnr-briefcase"></i> 岗位申请情况 </a></li>
                        <li sec:authorize="hasAnyAuthority('jobApproval')"><a th:class="${active == 'jobApproval' ? 'active' : ''}" th:href="@{/oa/jobs/jobApprovalPage}"><i class="lnr lnr-briefcase"></i> 申请审批情况 </a></li>
                        <li sec:authorize="hasAnyAuthority('jobStatusManage')" ><a th:class="${active == 'jobStatusManagement' ? 'active' : ''}" th:href="@{/oa/jobs/jobStatusManagementPage}"><i class="lnr lnr-briefcase"></i> 岗位状态管理 </a></li>
                    </ul>
                </li>
                <!-- ↓↓ 企业管理员可见（人事） ↓↓ -->
                <li sec:authorize="hasAnyAuthority('hrManage','createHR')" >
<!--                <li >-->
                    <h3>人事</h3>
                    <ul>
                        <li sec:authorize="hasAnyAuthority('hrManage')"><a th:class="${active == 'hrManagement' ? 'active' : ''}" th:href="@{/oa/company/hrManagementPage}"><i class="lnr lnr-briefcase"></i> HR 信息管理 </a></li>
                        <li sec:authorize="hasAnyAuthority('createHR')"><a th:class="${active == 'createHR' ? 'active' : ''}" th:href="@{/oa/company/createHRPage}"><i class="lnr lnr-briefcase"></i> 新增 HR </a></li>
                    </ul>
                </li>
            <!-- ▲▲▲▲▲ ===================================== ▲▲▲▲▲ -->

            <!-- ▼▼▼▼▼ ============= 应聘者模块 ============= ▼▼▼▼▼ -->
                <!-- 工作 -->
                <li sec:authorize="hasAnyAuthority('huntingStatus')" >
<!--                <li >-->
                    <h3>工作</h3>
                    <ul>
                        <li><a th:class="${active == 'huntingStatus' ? 'active' : ''}" th:href="@{/oa/jobs/huntingStatusPage}"><i class="lnr lnr-select"></i> 工作申请情况 </a></li>
                    </ul>
                </li>
                <!-- 收藏 -->
                <li sec:authorize="hasAnyAuthority('bookmarks','follows')" >
<!--                <li >-->
                    <h3>收藏</h3>
                    <ul>
                        <li sec:authorize="hasAnyAuthority('bookmarks')"><a th:class="${active == 'bookmarks' ? 'active' : ''}" th:href="@{/oa/jobs/bookmarksPage}"><i class="lnr lnr-heart"></i> 关注的岗位 </a></li>
                        <li sec:authorize="hasAnyAuthority('follows')"><a th:class="${active == 'follows' ? 'active' : ''}" th:href="@{/oa/company/followsPage}"><i class="lnr lnr-star"></i> 关注的企业 </a></li>
                    </ul>
                </li>
            <!-- ▲▲▲▲▲ ===================================== ▲▲▲▲▲ -->

            <!-- ▼▼▼▼▼ ============= 管理者模块 ============= ▼▼▼▼▼ -->
                <!-- 广告 -->
                <li sec:authorize="hasAnyAuthority('advertisement','createAdvertisement')" >
<!--                <li >-->
                    <h3>广告</h3>
                    <ul>
                        <li sec:authorize="hasAnyAuthority('advertisement')"><a th:class="${active == 'advertisement' ? 'active' : ''}" th:href="@{/oa/account/advertisementPage}"><i class="lnr lnr-chart-bars"></i> 广告合作管理 </a></li>
                        <li sec:authorize="hasAnyAuthority('createAdvertisement')"><a th:class="${active == 'createAdvertisement' ? 'active' : ''}" th:href="@{/oa/account/createAdvertisementPage}"><i class="lnr lnr-file-empty"></i> 新增广告 </a></li>
                    </ul>
                </li>
                <!-- 企业 -->
                <li sec:authorize="hasAnyAuthority('companyInfo','companyManage','memberOrder','memberManage')" >
<!--                <li >-->
                    <h3>企业</h3>
                    <ul>
                        <li sec:authorize="hasAnyAuthority('companyInfo')" ><a th:class="${active == 'companyInfo' ? 'active' : ''}" th:href="@{/oa/company/companyInfoPage}"><i class="lnr lnr-pointer-right"></i> 企业基本信息 </a></li>
                        <li sec:authorize="hasAnyAuthority('companyManage')" ><a th:class="${active == 'companyManagement' ? 'active' : ''}" th:href="@{/oa/company/companyManagementPage}"><i class="lnr lnr-bookmark"></i> 企业信息管理 </a></li>
                        <li sec:authorize="hasAnyAuthority('memberOrder')" ><a th:class="${active == 'memberOrder' ? 'active' : ''}" th:href="@{/oa/company/memberOrderPage}"><i class="lnr lnr-pointer-right"></i> 企业会员订单 </a></li>
                        <li sec:authorize="hasAnyAuthority('memberManage')" ><a th:class="${active == 'memberManagement' ? 'active' : ''}" th:href="@{/oa/company/memberManagement}"><i class="lnr lnr-diamond"></i> 企业会员信息管理 </a></li>
                    </ul>
                </li>
                <!-- 权限 -->
                <li sec:authorize="hasAnyAuthority('authorityManagement')" >
                    <!--                <li >-->
                    <h3>权限</h3>
                    <ul>
                        <li><a th:class="${active == 'authorityManagement' ? 'active' : ''}" th:href="@{/oa/account/authorityManagement}"><i class="lnr lnr-lock"></i> 权限管理 </a></li>
                    </ul>
                </li>
            <!-- ▲▲▲▲▲ ===================================== ▲▲▲▲▲ -->

            <!-- ▼▼▼▼▼ ============= 账户 ============= ▼▼▼▼▼ -->
                <li>
                    <h3>帐户</h3>
                    <ul>
                        <li sec:authorize="hasAnyAuthority('baseInfo')" ><a th:class="${active == 'baseInfo' ? 'active' : ''}" th:href="@{/oa/account/baseInfoPage}"><i class="lnr lnr-user"></i> 基本信息 </a></li>
                        <li sec:authorize="hasAnyAuthority('profile')" ><a th:class="${active == 'profile' ? 'active' : ''}" th:href="@{/oa/jobs/profilePage}"><i class="lnr lnr-license"></i> 我的简历 </a></li>
                        <li sec:authorize="hasAnyAuthority('changePassword')"><a th:class="${active == 'changePassword' ? 'active' : ''}" th:href="@{/oa/account/changePasswordPage}"><i class="lnr lnr-cog"></i> 修改密码 </a></li>
                        <li><a onclick="logOut()"><i class="lnr lnr-exit-up"></i> 登出 </a></li>
                    </ul>
                </li>
            <!-- ▲▲▲▲▲ ===================================== ▲▲▲▲▲ -->
            </ul>
        </div>
    </div>
</div>
<!-- 侧边栏 end -->

<!--对联广告-->
<div th:fragment="sideBillboard">
    <div class="coupletbox coupletbox-1">
        <a  class="closeBtn" id="btn-1" title="关闭"><span class="lnr lnr-cross"></span>关闭</a>
    </div>
    <div class="coupletbox coupletbox-2">
        <a  class="closeBtn" id="btn-2" title="关闭"><span class="lnr lnr-cross"></span>关闭</a>
    </div>
</div>
<!--End对联广告-->

<!--尾部 start-->
<footer th:fragment="footer" class="footer-section section bg_color--1">

    <!-- Footer Top Section Start -->
    <div class="footer-top-section section st-border pt-120 pt-lg-100 pt-md-80 pt-sm-60 pt-xs-50 pb-80 pb-lg-60 pb-md-40 pb-sm-20 pb-xs-15">
        <div class="container">
            <div class="row">

                <div class="col-xl-4 col-lg-3 col-md-6">
                    <!-- Footer Widget Start -->
                    <div class="footer-widget mb-30">
                        <div class="footer-logo">
                            <a href="index.html"><img th:src="@{/images/logo.png}" alt=""></a>
                        </div>
                        <div class="address">
                            <i class="lnr lnr-map-marker"></i>
                            <span>厦门工学院</span>
                        </div>
                        <div class="email">
                            <i class="lnr lnr-envelope"></i>
                            <span>934672344@qq.com</span>
                        </div>
                        <div class="phone theme-color fz-17">15711111111</div>
                        <div class="footer-social justify-content-start mt-35">
                            <a href="#"><i class="fab fa-qq"></i></a>
                            <a href="#"><i class="fab fa-weixin"></i></a>
                        </div>
                    </div>
                    <!-- Footer Widget End -->
                </div>

                <div class="col-xl-2 col-lg-2 col-md-6">
                    <!-- Footer Widget Start -->
                    <div class="footer-widget mb-30">
                        <h6 class="title">公司</h6>
                        <div class="footer-widget-link">
                            <ul>
                                <li><a href="#">新闻角</a></li>
                                <li><a href="#">政策私隐</a></li>
                                <li><a href="#">条款和条件</a></li>
                                <li><a href="#">伙伴</a></li>
                                <li><a href="#">帮助中心</a></li>
                                <li><a href="#">联系我们</a></li>
                            </ul>
                        </div>
                    </div>
                    <!-- Footer Widget End -->
                </div>

                <div class="col-xl-2 col-lg-3 col-md-6">
                    <!-- Footer Widget Start -->
                    <div class="footer-widget mb-30">
                        <h6 class="title">帮助中心</h6>
                        <div class="footer-widget-link">
                            <ul>
                                <li><a href="#">老师</a></li>
                                <li><a href="#">会计</a></li>
                                <li><a href="#">客户服务</a></li>
                                <li><a href="#">数字营销</a></li>
                                <li><a href="#">网络与软件开发</a></li>
                            </ul>
                        </div>
                    </div>
                    <!-- Footer Widget End -->
                </div>

                <div class="col-xl-4 col-lg-4 col-md-6">
                    <!-- Footer Widget Start -->
                    <div class="footer-widget mb-30">
                        <h6 class="title">告知</h6>
                        <div class="newsletter">
                            <p><strong>该网站为个人作品，可以通过邮箱交流想法</strong></p>
                        </div>
                    </div>
                    <!-- Footer Widget End -->
                </div>
            </div>
        </div>
    </div>
    <!-- Footer Top Section End -->
    <!--Footer bottom start-->
    <div class="footer-bottom section fb-60">
        <div class="container">
            <div class="row no-gutters st-border pt-35 pb-35 align-items-center justify-content-between">
            </div>
        </div>
    </div>
    <!--Footer bottom end-->
</footer>
<!--尾部 section end-->
</body>

<div th:fragment="public-js">
    <!-- 此处包含所有jquery文件 -->
    <script th:src="@{/js/vendor/jquery-3.5.0.min.js}"></script>
    <script th:src="@{/js/vendor/jquery-migrate-3.1.0.min.js}"></script>
    <script th:src="@{/js/vendor/bootstrap.bundle.min.js}"></script>
    <script th:src="@{/js/plugins/plugins.min.js}"></script>
    <script th:src="@{/js/plugins/jquery.form.min.js}"></script>
    <script th:src="@{/js/plugins/jquery-confirm.min.js}"></script>
    <script th:src="@{/js/main.js}"></script>

    <script th:src="@{/js/plugins/pageMe.js}"></script>
    <script th:src="@{/js/plugins/coco-message.js}"></script>

    <script th:src="@{/js/test.js}"></script>

    <script th:src="@{/js/myjob/auth.js}"></script>
    <script type="text/javascript">
        // 网关配置的前缀
        let accountServer = "/accountSer"

        // let authorization = "";
        // let refresh_token = "";

        $(document).ready(function(){
            $.ajaxSettings.async = false;
            $.getJSON("/js/properties.json", function (data) {
                accountServer = data.accountServer;
            });
            // authorization = getCookie("Authorization")
            // refresh_token = getCookie("refreshToken")
            getAdvertiseOne();
        });
        function getAdvertiseOne() {
            $.ajax({
                type: "get",
                async: false,
                url: accountServer + "/account/advertise",
                data: {
                    currentPage: -1,
                    level: "一级",
                },
                success: function (data) {
                    console.log("一级广告");

                    $.each(data.datas, function (i, item){
                        $(".coupletbox-"+(i+1)).css("backgroundImage","url("+item.photo+")")
                                .css("background-repeat", "no-repeat")
                                .css('background-size', '100% 100%');
                    })
                },
                error: function (err) {
                    console.log(err);
                }

            });
        }
        $(function () {
            $(".coupletbox").clonefn({
                cloneto: false,//是否允许克隆
                initial: "top", //初始位置top或down
                closeBtn: ".closeBtn",//关闭按钮
                speed: 1000,//动画速度
                easing: "easeInOutBack",//扩展动画，是基于jQuery Easing v1.3官方下载地址http://gsgd.co.uk/sandbox/jquery/easing/
            });
        });

        function logOut(){
            setAuthCookie("", -1);
            refreshAuth("", "", "logout");
            // 跳转首页
            $.ajax({
                url:"/logout",
                type: "GET",
                success: function (data){
                    console.log(data)
                    toHomePage("o");
                },
                error: function (err) {
                    console.log(err);
                    toHomePage("o");
                }
            })
        }

        function setAuthCookie(data, outTime){
            let token = "";
            let refreshToken = "";
            let tokenHead = "";
            let expiresIn = "";

            if (outTime === 1){
                // 为 1 表示登录成功，其他为失败
                token = data.datas.token;
                refreshToken = data.datas.refreshToken;
                tokenHead = data.datas.tokenHead;
                expiresIn = data.datas.expiresIn;
            }
            let date = new Date();
            date.setTime( date.getTime() + (expiresIn * outTime *1000) );
            let expires = "expires="+date.toUTCString();
            document.cookie = "Authorization= "+tokenHead+""+token+";expires="+expires+";path=/";
            document.cookie = "refreshToken=" + refreshToken+";expires="+expires+";path=/";
        }

        function toHomePage(flag){
            window.location.replace("/oa/account/homepage#"+flag);
        }

        function refreshAuth(Authorization, refreshToken, logout){
            if (logout === "" || logout === null){
                logout = "";
            }
            $.ajax({
                url:"/oa/account/public",
                type: "GET",
                headers: {
                    "Authorization": Authorization,
                    "refreshToken": refreshToken,
                    "logout": logout
                },
                success: function (data){
                    window.location.href = url;
                },
                error: function (err) {
                    console.log(err);
                }
            })
        }
    </script>

</div>

</html>
